/**
 * 
 */
package net.toocruel.iqismart.dao.condition;

import org.apache.commons.beanutils.ConvertUtils;

/**
 * @author toocruel
 *
 */
public class TagCondition {

	private String name;
	private String nameStart;
	private Long categoryId;
	private String logo;
	private String summary;
	private String description;
	private Long parentId;
	private Long[] ids;

	public static TagCondition withIds(String tagIds) {
		String[] split = tagIds.split(",");
		TagCondition tagCondition = new TagCondition();
		tagCondition.setIds((Long[]) ConvertUtils.convert(split,Long.class));
		return tagCondition;
	}

	public Long[] getIds() {
		return ids;
	}

	public void setIds(Long[] ids) {
		this.ids = ids;
	}

	public TagCondition() {
	}

	public static TagCondition withNameStart(String word) {
		TagCondition tagCondition = new TagCondition();
		tagCondition.setNameStart(word);
		return tagCondition;
	}

	public static TagCondition withNameStartAndCategoryId(String word,Long categoryId) {
		TagCondition tagCondition = withNameStart(word);
		tagCondition.setCategoryId(categoryId);
		return tagCondition;
	}


	public String getNameStart() {
		return nameStart;
	}

	public void setNameStart(String nameStart) {
		this.nameStart = nameStart;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}
}
